//分片上传
import request from '@/config/axios'

export const updateGallery = async (data: any) => {
  return await request.put({ url: '/gallery/base/update', data })
}

export const galleryImagesPage = async (params: any) => {
  return await request.get({ url: '/gallery/images/page', params })
}

export const bindGallery = async (data: any) => {
  return await request.post({ url: '/gallery/images/create', data })
}

export const deleteGallery = async (id: number) => {
  return await request.delete({ url: '/gallery/base/delete?id=' + id })
}

export const getGalleryPage = async (params: any) => {
  return await request.get({ url: '/gallery/base/page', params })
}

export const getGallery = async (params: any) => {
  return await request.get({ url: '/gallery/base/get', params })
}

export const createGallery = async (data: any) => {
  return await request.post({ url: '/gallery/base/create', data })
}

export const fileUpload = async (data: any) => {
  return await request.post({ url: '/gallery/file/upload', data })
}

export const mergeUpload = async (data: any) => {
  return await request.get({
    url: `/gallery/file/merge?identifier=${data.identifier}&galleryId=${data.galleryId}`,
    headersType: 'application/x-www-form-urlencoded'
  })
}
